//入口文件
import Vue from 'vue'
//导入app根组件
import app from './App.vue'
//导入路由对象
import router from './router'

//axios配置默认属性
import axios from 'axios'
axios.defaults.baseURL = 'http://www.liulongbin.top:3005'

//定义全局事件过滤器
//导入事件格式moment插件
import moment from 'moment'
Vue.filter('dateFormat', function(dataStr, pattern = 'YYYY-MM-DD HH:mm:ss') {
  return moment(dataStr).format(pattern)
})

// 按需导入Mint-UI
import { Header, Swipe, SwipeItem, Button } from 'mint-ui'
Vue.component(Header.name, Header)
Vue.component(Swipe.name, Swipe)
Vue.component(SwipeItem.name, SwipeItem)
Vue.component(Button.name, Button)

// 导入MUI组件
import './lib/mui/css/mui.css'
import './lib/mui/css/icons-extra.css'

const vm = new Vue({
  el: '#app',
  render: c => c(app),
  router // 4. 将路由对象挂载到 vm 上
})
